"""2.4 数据类型—字符串类型"""
#字符串的定义
#1.单引号
name='Tom'
print(name)
print(type(name))
#2.双引号
name="Tom"
print(name)
print(type(name))
#3.三引号
name="""Tom
is a student，age is 18!"""
print(name)
print(type(name))
name2='''Tom
is a student，age is 18!'''
print(name2)
print(type(name2))
#字符拼接
name="Tom"
age=18
combined=name+" "+str(age)
print("字符拼接：",combined)


#字符重复
name="Tom"
repeated=name*3
print("字符重复：",repeated)
#字符格式化，f-string
name="Tom"
age=18
formatted=f"我的名字是{name},年龄是{age}"
print("字符格式化f-string：",formatted)




